/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.belfalas.simy86.operadores;

import org.belfalas.simy86.ConditionCodes;

/**
 *
 * @author belfalas
 */
public class ADDL extends OP1{

    @Override
    public void execute(org.belfalas.simy86.Operador_Stat stat) {
        super.execute(stat);
        stat.valE = stat.valB + stat.valA;
        setCC(stat);
    }

    @Override
    void setCC(org.belfalas.simy86.Operador_Stat stat) {        
        ConditionCodes.setOF((stat.valA < 0 == stat.valB < 0) && (stat.valE < 0 != stat.valA < 0));
        ConditionCodes.setZF(stat.valE == 0);
        ConditionCodes.setSF(stat.valE < 0);
    }
    
}
